#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int* sockCollocation(int* sockets, int socketsSize) {
    int i = 0;
    int val1 = 0;
    int val2 = 0;
    int val3 = 0;
    int x = 0;
    int* arr = (int*)malloc(2 * sizeof(int));
    for (i = 0; i < socketsSize; i++)
    {
        val1 ^= sockets[i];
    }

    for (i = 0; i < 32; i++)
    {
        if (((val1 >> i) & 1) == 1)
        {
            x = i;
            break;
        }

    }
    for (i = 0; i < socketsSize; i++)
    {
        if (((sockets[i] >> x) & 1) == 1)
        {
            val2 ^= sockets[i];
        }
        else
        {
            val3 ^= sockets[i];
        }
    }
    arr[0] = val2;
    arr[1] = val3;
    return arr;


}

int main()
{
	int arr[] = { 1,5,1,6,2,2,3,3 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	int* parr= sockCollocation(arr,sz);
    for (int i = 0; i < 2; i++)
    {
        printf("%d", parr[i]);
    }
	return 0;
}